import "./banner-list.css";
import tpl from "./banner-list.tpl";

import {tplReplace} from "../../../utils/tools"

export default (listData)=>{
    return{
        name:"banner-list",
        tpl(){
            let list = "",
                oneData = listData[0];
            listData.forEach(function(v,i){
                list += tplReplace(tpl(),{
                    bannerName:v.banner_name,
                    img:v.img
                });

            });
            list += tplReplace(tpl(),{
                bannerName:oneData.banner_name,
                img:oneData.img
            });
            return list;
        }
    }
}
